package com.hundsun.cprs.yyt.gateway.service.uc.impl;

import com.hundsun.cprs.yyt.gateway.enums.EnumFundBankNo;
import com.hundsun.cprs.yyt.gateway.response.BaseResponse;
import com.hundsun.cprs.yyt.gateway.service.uc.BankBindingService;
import com.hundsun.cprs.yyt.service.common.dto.FundCloseInfo;
import com.hundsun.cprs.yyt.service.common.dto.FundOpenInfo;
import com.hundsun.cprs.yyt.service.common.service.RemoteTradeFundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SQPayBankBindingServiceImpl implements BankBindingService {

    @Autowired
    private RemoteTradeFundService remoteTradeFundService;

    @Override
    public String getBankNo() {
        return EnumFundBankNo.SQPAY.getCode();
    }

    @Override
    public void bindingValidate(FundOpenInfo request, BaseResponse response) {
        //双乾支付直接绑卡
        binding(request, response);
    }

    @Override
    public void binding(FundOpenInfo request, BaseResponse response) {
        remoteTradeFundService.open(request);
    }

    @Override
    public void unBinding(FundCloseInfo request, BaseResponse response) {
        remoteTradeFundService.close(request);
    }
}
